from func import SQLServer

alist = """2100100
2100101
2100102
2100103
2100104
2100105
2100106
2100107
2100108
2100109
2100110
2100111
2100112
2100113
2100114
2100115
2100116
2100117
2100118
2100119
2100120
2100121
2100122
2100123
2100124
2100125
2100126
2100127
2100128
2100129
2100130
2100131
2100132
2100133
2100134
2100135
2100136
2100137
2100138
2100140
2100141
2100142
2100143
2100144
2100145
2100146
2100147
2100148
2100149
2100150
2100151
2100152
2100153
2100154
2100155
2100156
2100157
2100158
2100159
2100160
2100161
2100162
2100163
2100164
2100165
2100166
2100167
2100168
2100169
2100170
2100171
2100172
2100173
2100174
2100175
2100176
2100177
2100178
2100179
2100181
2100182
2100183
2100185
2100186
2100187
2100189
2100190
2100191
2100192
2100193
2100194
2100195
2100196
2100197
2100198
2100199
2100200
2100201
2100203
2100204
2100205
2100206
2100207
2100208
2100209
2100210
2100211
2100212
2100213
2100214
2100215
2100216
2100217
2100218
2100219
2100220
2100221
2100222
2100223
2100224
2100225
2100226
2100227
2100228
2100229
2100232
2100233
2100234
2100235
2100236
2100237
2100238
2100239
2100240
2100241
2100242
2100243
2100244
2100245
2100246
2100247
2100248
2100249
2100250
2100251
2100252
2100253
2100254
2100256
2100257
2100258
2100259
2100260
2100261
2100262
2100263
2100264
2100265
2100266
2100267
2100268
2100269
2100270
2100271
2100272
2100273
2100274
2100275
2100276
2100277
2100278
2100279
2100280
2100281
2100283
2100284
2100285
2100286
2100287
2100288
2100289
2100290
2100291
2100292
2100293
2100294
2100295
2100296
2100297
2100298
2100299
2100300
2100301
2100302
2100303
2100304
2100305
2100306
2100307
2100308
2100310
2100311
2100312
2100313
2100314
2100315
2100316
2100317
2100318
2100319
2100320
2100321
2100322
2100323
2100324
2100325
2100326
2100327
2100328
2100329
2100330
2100331
2100332
2100333
2100334
2100335
2100336
2100337
2100338
2100340
2100341
2100342
2100343
2100344
2100345
2100346
2100347
2100348
2100349
2100350
2100351
2100353
2100354
2100355
2100356
2100357
2100358
2100359
2100360
2100361
2100362
2100363
2100364
2100366
2100367
2100368
2100369
2100370
2100371
2100372
2100373
2100374
2100375
2100376
2100377
2100378
2100379
2100380
2100381
2100382
2100383
2100384
2100385
2100386
2100387
2100388
2100389
2100390
2100391
2100392
2100394
2100395
2100396
2100397
2100398
2100399
2100400
2100401
2100402
2100404
2100405
2100406
2100407
2100408
2100409
2100410
2100411
2100412
2100413
2100414
2100415
2100416
2100417
2100418
2100419
2100420
2100421
2100422
2100423
2100425
2100426
2100429
2100430
2100431
2100432
2100433
2100435
2100436
2100438
2100439
2100440
2100441
2100442
2100444
2100445
2100446
2100447
2100448
2100449
2100450
2100451
2100452
2100453
2100454
2100455
2100456
2100457
2100458
2100459
2100460
2100461
2100462
2100463
2100464
2100465
2100466
2100467
2100468
2100470
2100472
2100473
2100474
2100475
2100476
2100477
2100478
2100479
2100480
2100482
2100483
2100485
2100486
2100487
2100488
2100489
2100490
2100491
2100492
2100493
2100494
2100495
2100496
2100497
2100498""".split("\n")
# alist = [5200687]
sql_server = SQLServer()
for num, oid in enumerate(alist):
    sql = f'SELECT * FROM t_review_page WHERE org_id = {oid}'
    alist = sql_server.query(sql)
    print(num, '      ', oid, '       ', len(alist))


# sql = f'SELECT count(*) FROM t_review_page WHERE org_id = 1500156'
# print(sql_server.query(sql))
